package com.mobor.moborsvr.infra.config;

//import java.util.Properties;
//
//import javax.sql.DataSource;
//
//import org.hibernate.SessionFactory;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.io.Resource;
//import org.springframework.jdbc.datasource.DriverManagerDataSource;
//import org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean;
//
//import com.mobor.moborsvr.infra.util.ApplicationContextProviderUtil;

//@Configuration
public class MoborAppConfiguration {
	
//	private @Value("#{jdbc.url}") String jdbcUrl;
//    private @Value("#{jdbc.username}") String username;
//    private @Value("#{jdbc.password}") String password;
//    private @Value("#{jdbc.driverClassName}") String driverClassName;
//    
//    @Bean(name="moborSessionFactory")
//    public SessionFactory sessionFactory() {
//        AnnotationSessionFactoryBean factoryBean = new AnnotationSessionFactoryBean();
//        factoryBean.setDataSource(dataSource());
//        Resource hibernateConfig = ApplicationContextProviderUtil.getApplicationContext().getResource("classpath:hib.cfg.xml");
//        factoryBean.setConfigLocation(hibernateConfig);
//        Properties hibernateProperties = new Properties();
//        hibernateProperties.setProperty("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
//        factoryBean.setHibernateProperties(hibernateProperties);
//        
//        return factoryBean.getObject();
//    }
//    
//    @Bean(name="moborDataSource")
//    public DataSource dataSource() { 
//        return new DriverManagerDataSource(jdbcUrl, username, password);
//    }
//    
//	public String getJdbcUrl() {
//		return jdbcUrl;
//	}
//	public void setJdbcUrl(String jdbcUrl) {
//		this.jdbcUrl = jdbcUrl;
//	}
//	public String getUsername() {
//		return username;
//	}
//	public void setUsername(String username) {
//		this.username = username;
//	}
//	public String getPassword() {
//		return password;
//	}
//	public void setPassword(String password) {
//		this.password = password;
//	}
//	public String getDriverClassName() {
//		return driverClassName;
//	}
//	public void setDriverClassName(String driverClassName) {
//		this.driverClassName = driverClassName;
//	}
}
